package com.zdyt.opc.exception;


import com.zdyt.opc.common.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice(basePackages = "com.zdyt.opc.controller")
public class ExceptionControllerAdvice {

    //所有异常兜底处理
    @ExceptionHandler(value = Exception.class)
    public ResultEntity<String> handleException(Exception e){

        log.error("系统位置异常",e);

        return ResultEntity.failed(e.getMessage());
    }
}
